﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Esosi.Entity
{
    public class HisContext : DbContext
    {
        public HisContext(DbContextOptions<HisContext> options)
         : base(options)
        {
        }

        public DbSet<GmPrice> GmPrices { get; set; }
        public DbSet<GmChargePolicy> GmChargePolicys { get; set; }
        public DbSet<GmChargePolicyDetail> GmChargePolicyDetails { get; set; }
        public DbSet<GrChargePolicyReference> GrChargePolicyReferences { get; set; }
        public DbSet<CrDeptRegFee> CrDeptRegFees { get; set; }

        public DbSet<CtJsonRegisterInfo> CtJsonRegisterInfos { get; set; }

        public DbSet<CtInvice> CtInvices { get; set; }

        public DbSet<CtFee> CtFees { get; set; }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //modelBuilder.HasSequence("GR_DUTY_SEQ").IncrementsBy(1);
            //modelBuilder.Entity<GrDuty>(entity =>
            //{
            //    entity.ToTable("GR_DUTY");
            //    entity.Property(o => o.DutyId).ForOracleUseSequenceHiLo("GR_DUTY_SEQ");
            //});

            //modelBuilder.HasSequence("GM_USER_SEQ").IncrementsBy(1);
            //modelBuilder.Entity<GmUser>(entity =>
            //{
            //    entity.ToTable("GM_USER");
            //    entity.Property(o => o.UserId).ForOracleUseSequenceHiLo("GM_USER_SEQ");
            //});

            base.OnModelCreating(modelBuilder);
        }

        //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        //{
        //    base.OnConfiguring(optionsBuilder);
        //    optionsBuilder.EnableSensitiveDataLogging();
        //    optionsBuilder.UseOracle("User Id=owhis;Password=owhis;Data Source=192.168.31.31/xltest;", b => b.UseOracleSQLCompatibility("11"));
        //}
    }
}